const path = require('path')

const dirname1 = path.dirname("C:\\Users\\gxh\\file-assets\\202207\\4b88751e-a6e5-4f5d-b2a1-792110500bec.xlsx")
const dirname2 = path.dirname("202207\\4b88751e-a6e5-4f5d-b2a1-792110500bec.xlsx")
console.log('dirname1',dirname1);
console.log('dirname2',dirname2);


const basename = path.basename("C:\\Users\\gxh\\file-assets\\202207\\4b88751e-a6e5-4f5d-b2a1-792110500bec.xlsx")
console.log('basename',basename);

// 格式化为绝对路径
const resolve = path.resolve('C:/my-upload-files')
const resolve2 = path.resolve('../my-upload-files')
console.log('resolve',resolve);
console.log('resolve2',resolve2);